package com.ruoyi.zhgd.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.annotation.DataColumn;
import com.ruoyi.common.annotation.DataPermission;
import com.ruoyi.zhgd.domain.NAsphaltDataSieve;
import com.ruoyi.zhgd.domain.bo.NAsphaltDataSieveBo;
import com.ruoyi.zhgd.domain.vo.NAsphaltDataSieveVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.zhgd.domain.vo.NAsphaltDataSievingAvgVo;
import com.ruoyi.zhgd.domain.vo.NAsphaltProduceSievePassRateVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 沥青拌合站数据Mapper接口
 *
 * @author zyb
 * @date 2023-09-06
 */
public interface NAsphaltDataSieveMapper extends BaseMapperPlus<NAsphaltDataSieveMapper, NAsphaltDataSieve, NAsphaltDataSieveVo> {

    /**
     * 生产数据监控级配分页
     * @param build
     * @param bo
     * @return
     */
    @DataPermission(
        @DataColumn(key = "deptName", value = "p.dept_id")
    )
    Page<NAsphaltDataSieveVo> page(Page<Object> build, @Param("params") NAsphaltDataSieveBo bo);

    /**
     * 获取全天筛孔数据
     * @param stationCode 拌和站编号
     * @param matchCode 级配编号
     * @param day 日期
     * @return 全天筛孔数据
     */
    List<NAsphaltDataSieve> listForDay(@Param("stationCode") String stationCode,
                                       @Param("matchCode") String matchCode, @Param("day") String day);

    NAsphaltDataSieveVo getById(@Param("id") String id);

    /**
     * 关键筛孔通过率
     * @param bo
     * @param build
     * @return
     */
    @DataPermission(
        @DataColumn(key = "deptName", value = "p.dept_id")
    )
    Page<NAsphaltProduceSievePassRateVo> produceSievePassRate(@Param("params") NAsphaltDataSieveBo bo, Page<Object> build);

    NAsphaltDataSievingAvgVo avgForDay(@Param("stationCode") String stationCode, @Param("matchCode") String matchCode, @Param("day") String day);
}
